#ifndef __ListSmile_h__
#define __ListSmile_h__
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
#include "SmileStruct.h"
#include "ListE.h"
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------

class listSmile {

    private:

        char     *filename;

        TListE   *allSmilesMol;

        float   **lingoSimilarity;
        float    *averageSimDistance;

        bool      fileGZ;

    protected:

        int   SplitPosLineIdCode(char*, int);
        char* SplitPosLineIdCodeC(char*, int);
        int   OrderListAncestor(int**&, int, int);
        int   OrderListAncestor(char***&, int, int);
        void  MixArray(long*, int);
        void  MixArrayX(long*, int, long*, int, long*);
        void  MergeSort(long*, int);
        
    public:

        //Constructor and Destructor
        listSmile();
        listSmile(char *);
        ~listSmile();

        //Input Functions
        void Filename(char*);
        void FileGZ(bool);

        //Output Functions
        char*   Filename(void);
        bool    FileGZ(void);
        TListE* AllSmiles(void);

        //Operations Funtions
        int ExtractSmiles(void);
        int ExtractSmiles(char*);
        int ExtractSmiles(int, int);
        int ExtractSmiles(char*, int, int);

        int ExtractGZSmiles(void);
        int ExtractGZSmiles(char*);
        int ExtractGZSmiles(int, int);
        int ExtractGZSmiles(char*, int, int);
        
        int ObtainLingos(void);
        int ObtainLingos(char*);
        int ObtainSimilarityMatrix(void);
        int ObtainAverageSimDistance(void);

        void RandomFile(int);
        void ReadRandomFile(void);

        void RandomGZFile(int);
        void ReadRandomGZFile(void);

        void OrderFile(char*, char*, int);
        void ReduceFile(char*, char*);

        void OrderGZFile(char*, char*, int);
        void ReduceGZFile(char*, char*);

        float ObtainLingoSim(char*, char*);
};

#endif
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------

